#ifndef __Configs_H__
#define __Configs_H__
#include "json/rapidjson.h"
#include "json/document.h"

#include "ConfigBase.h"
#include "cocos2d.h"
USING_NS_CC;
using namespace std;


class CLoader
{
public:
	static void loadConfig();
};

class CItemData :public CConfigBase
{
public:
	CItemData();
	virtual ~CItemData();

	CC_SYNTHESIZE(string, m_strNormalPath, NormalPath);
	CC_SYNTHESIZE(string, m_strLinePath, LinePath);
	CC_SYNTHESIZE(string, m_strRangePath, RangePath);
	CC_SYNTHESIZE(string, m_strSelectPath, SelectPath);
	CC_SYNTHESIZE(bool, m_bIsSelected, Selection);
private:

};

class CItemDataManager :public CConfigManagerBase
{
public:
	CItemDataManager();
	virtual ~CItemDataManager();

	CItemData* getItemDataById(const int nId);
	CItemData* getRandomItemData();
	virtual void parse(rapidjson::Value& vValue);
	CC_SYNTHESIZE(vector<CItemData*>, m_pVecItem, ItemList);
private:

};

class CLevelData :public CConfigBase
{
public:
	CLevelData();
	virtual ~CLevelData();

	CC_SYNTHESIZE(string, m_strTitle, Title);
	CC_SYNTHESIZE(int, m_nWidth, Width);
	CC_SYNTHESIZE(int, m_nHeight, Height);
	CC_SYNTHESIZE(int, m_nSeed, Seed);
	CC_SYNTHESIZE(int, m_nStep, Step);

	struct TargetData
	{
		int nId;
		int nCount;
	};

	void addTarget(TargetData* pTargetData);

	CC_SYNTHESIZE_READONLY(vector<TargetData*>, m_vecTargets, Targets);
private:

};

class CLevelDataManager :public CConfigManagerBase
{
public:
	CLevelDataManager();
	virtual ~CLevelDataManager();

	CLevelData* getLevelDataById(const int nId);
	CLevelData* getLevelDataByIndex(const int nIndex);
	virtual void parse(rapidjson::Value& vValue);
	CC_SYNTHESIZE(vector<CLevelData*>, m_pVecLevelData, DataList);
private:

};

#endif